<!DOCTYPE html>
<html>
<head>
	<title>a</title>
</head>
<body>
<div>
	<a href="ssdf">adfg</a>
</div>
</body>
<script type="text/javascript">
	
/* 阻止默认事件

	1. return false
	2. e.preventDefault()
*/

var a = document.getElementsByTagName('a')[0];
a.onclick = function(e) {
	alert('ok');
	// return false;
	e.preventDefault();
}

</script>
</html>